<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Change slaveOkay setting for this collection</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="mongocollection.setreadpreference.html">« MongoCollection::setReadPreference</a></li>
      <li style="float: right;"><a href="mongocollection.setwriteconcern.html">MongoCollection::setWriteConcern »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="class.mongocollection.html">MongoCollection</a></li>
    <li>Change slaveOkay setting for this collection</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="mongocollection.setslaveokay" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">MongoCollection::setSlaveOkay</h1>
  <p class="verinfo">(PECL mongo &gt;=1.1.0)</p><p class="refpurpose"><span class="refname">MongoCollection::setSlaveOkay</span> &mdash; <span class="dc-title">Change slaveOkay setting for this collection</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-mongocollection.setslaveokay-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>MongoCollection::setSlaveOkay</strong></span>(<span class="methodparam"><span class="type">bool</span> <code class="parameter">$ok</code><span class="initializer"> = <strong><code>true</code></strong></span></span>): <span class="type">bool</span></div>


  <p class="para rdfs-comment">
   See <a href="mongo.queries.html" class="link">the query section</a> of this manual for
   information on distributing reads to secondaries.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-mongocollection.setslaveokay-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>

    
     <dt>

      <code class="parameter">ok</code>
     </dt>

     <dd>

      <p class="para">
       If reads should be sent to secondary members of a replica set for all 
       possible queries using this <a href="class.mongocollection.html" class="classname">MongoCollection</a> 
       instance.
      </p>
     </dd>

       
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-mongocollection.setslaveokay-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns the former value of slaveOkay for this instance.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-mongocollection.setslaveokay-changelog">
  <h3 class="title">Changelog</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>Version</th>
       <th>Description</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>PECL mongo 1.2.11</td>
       <td>Emits <strong><code>E_DEPRECATED</code></strong> when used.</td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-mongocollection.setslaveokay-seealso">
  <h3 class="title">See Also</h3>
  <ul class="simplelist">
   <li class="member"><a href="mongo.readpreferences.html" class="xref">Read Preferences</a></li>
   <li class="member"><span class="methodname"><a href="mongocollection.setreadpreference.html" class="methodname" rel="rdfs-seeAlso">MongoCollection::setReadPreference()</a> - Set the read preference for this collection</span></li>
  </ul>
 </div>


</div></div></div></body></html>